include ../rules.mk
include ../opencl.mk

SOURCES :=  types.c device.c platform.c driver.c devmap.c context.c buffer.c chunk.c code.c program.c kernel.c queue.c
OBJECTS := $(call to_object,$(SOURCES))
DEPENDS := $(OBJECTS:.o=.d)

all: enter ../.libs/libocl.a leave
	
flags:
	@echo "Current Settings"
	@echo "CC       = $(CC)"
	@echo "CFLAGS   = $(CFLAGS)"
	@echo "LDFLAGS  = $(LDFLAGS)"
	
enter:
	@echo "==> building in $(HERE)"

leave:
	@echo "==> all done in $(HERE)"

../.libs/libocl.a: $(OBJECTS)
	@echo "====> Archiving $@"
	@ar cruv $@ $^
	@echo "====> Finished"

clean:
	$(CLEAN)
	@$(MAKE) -s -C tests clean

-include $(DEPENDS)

